import Vue from 'vue'
import VueRouter from 'vue-router'
import Admin from '_views/Admin'
Vue.use(VueRouter)

const routes = [{
  path: '/',
  component: Admin,
  children: [
    {
      path: '/dashBoard',
      name: '仪表盘',
      component: () => import('_views/DashBoard')
    },
    {
      path: '/itemLists',
      name: '商品管理',
      component: () => import('_views/Items')
    },
    {
      path: '/itemAdd',
      name: '增加商品',
      component: () => import('_views/Items/components/ItemAdd')
    },
    {
      path: '/itemUpdate',
      name: '修改商品',
      component: () => import('_views/Items/components/ItemUpdate')
    },
    {
      path: '/cateLists',
      name: '分类管理',
      component: () => import('_views/Cate')
    },
    {
      path: '/user',
      name: '个人中心',
      component: () => import('_views/SetUser')
    },
    {
      path: '/setting',
      name: '这是',
      component: () => import('_views/Setting')
    }
  ]
},
{
  path: '/login',
  component: () =>
    import('_views/Login')
},
{
  path: '*',
  component: () =>
    import('_views/NotFound')
}
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
